
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpInfoBusi.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpInfoBusiForm"
 */
public class CcpInfoBusiForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cibGuid = null;
   private java.lang.String _name = null;
   private java.lang.String _cfbLabel = null;
   private java.lang.String _alias = null;
   private java.lang.String _title = null;
   private java.lang.String _subTitle = null;
   private java.lang.String _genDate = null;
   private java.lang.String _remark = null;

   /**
    * Standard constructor.
    */
   public CcpInfoBusiForm() {
   }

   /**
    * Returns the cibGuid
    *
    * @return the cibGuid
    */
   public java.lang.String getCibGuid() {
      return _cibGuid;
   }

   /**
    * Sets the cibGuid
    *
    * @param cibGuid the new cibGuid value
    */
   public void setCibGuid(java.lang.String cibGuid) {
      _cibGuid = cibGuid;
   }
   /**
    * Returns the name
    *
    * @return the name
    */
   public java.lang.String getName() {
      return _name;
   }

   /**
    * Sets the name
    *
    * @param name the new name value
    */
   public void setName(java.lang.String name) {
      _name = name;
   }
   /**
    * Returns the cfbLabel
    *
    * @return the cfbLabel
    */
   public java.lang.String getCfbLabel() {
      return _cfbLabel;
   }

   /**
    * Sets the cfbLabel
    *
    * @param cfbLabel the new cfbLabel value
    */
   public void setCfbLabel(java.lang.String cfbLabel) {
      _cfbLabel = cfbLabel;
   }
   /**
    * Returns the alias
    *
    * @return the alias
    */
   public java.lang.String getAlias() {
      return _alias;
   }

   /**
    * Sets the alias
    *
    * @param alias the new alias value
    */
   public void setAlias(java.lang.String alias) {
      _alias = alias;
   }
   /**
    * Returns the title
    *
    * @return the title
    */
   public java.lang.String getTitle() {
      return _title;
   }

   /**
    * Sets the title
    *
    * @param title the new title value
    */
   public void setTitle(java.lang.String title) {
      _title = title;
   }
   /**
    * Returns the subTitle
    *
    * @return the subTitle
    */
   public java.lang.String getSubTitle() {
      return _subTitle;
   }

   /**
    * Sets the subTitle
    *
    * @param subTitle the new subTitle value
    */
   public void setSubTitle(java.lang.String subTitle) {
      _subTitle = subTitle;
   }
   /**
    * Returns the genDate
    *
    * @return the genDate
    */
   public java.lang.String getGenDate() {
      return _genDate;
   }

   /**
    * Sets the genDate
    *
    * @param genDate the new genDate value
    */
   public void setGenDate(java.lang.String genDate) {
      _genDate = genDate;
   }
   /**
    * Returns the remark
    *
    * @return the remark
    */
   public java.lang.String getRemark() {
      return _remark;
   }

   /**
    * Sets the remark
    *
    * @param remark the new remark value
    */
   public void setRemark(java.lang.String remark) {
      _remark = remark;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCibGuid() == null) {
         errors.add("cibGuid", new ActionError("error.cibGuid.required"));
      }
      if(getName() == null) {
         errors.add("name", new ActionError("error.name.required"));
      }
      if(getCfbLabel() == null) {
         errors.add("cfbLabel", new ActionError("error.cfbLabel.required"));
      }
      if(getAlias() == null) {
         errors.add("alias", new ActionError("error.alias.required"));
      }
      // TODO test format/data
      return errors;
   }
}
